import App from './App'

import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'


//uView
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)



//通用方法
import utils from 'utils/utils.js'
Vue.use(utils)


//请求
import httpInterceptor from '@/common/api.js';
Vue.prototype.$api = httpInterceptor


//
import store from 'store/index.js'

Vue.filter('formatDate', function(value) {
	var now = new Date(value*1000);
	var year = now.getFullYear();
	var month = now.getMonth() + 1 < 10 ? '0' + (now.getMonth() + 1) : (now.getMonth() + 1);
	var day = now.getDate() < 10 ? '0' + now.getDate() : now.getDate();
	var hour = now.getHours() < 10 ? '0' + now.getHours() : now.getHours();
	var minute = now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes();
	var second = now.getSeconds() < 10 ? '0' + now.getSeconds() : now.getSeconds();
	let data = {
		year,
		month,
		day,
		hour,
		minute,
		second,
		time: hour + '：' + minute 
	}
	return data.time;
})

const app = new Vue({
  ...App,
  store
})
app.$mount()
